import factory from '@adonisjs/lucid/factories'
import Member from '#models/member'

export const MemberFactory = factory
  .define(Member, async ({ faker }) => {
    return {
      fkShopId: faker.number.int({ min: 1, max: 10 }),
      type: faker.number.int({ min: 1, max: 2 }),
      name: faker.person.fullName(),
      nickName: faker.person.fullName(),
      phone: faker.phone.number('###########'),
      email: faker.internet.email(),
      sex: faker.number.int({ min: 0, max: 2 }),
      avatarUrl: faker.internet.avatar(),
      age: faker.number.int({ min: 18, max: 50 }),
      openid: faker.string.nanoid(),
      unionid: faker.string.nanoid(),
      birthdayType: faker.number.int({ min: 1, max: 2 }),
      birthday: new Date(),
      lunarBirthday: new Date(),
      status: faker.number.int({ min: 0, max: 1 }),
    }
  })
  .build()
